<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #root {
            display: flex;
            flex-direction: column
        }

        p {
            margin: 0;
        }
    </style>
</head>
<body>

<div id="root"></div>

<script>
    for (let i = 0; i < 5; i++) {
        let p = document.createElement("p");
        for (let j = 0; j <= i; j++) {
            p.innerHTML += "*";
        }
        document.getElementById("root").appendChild(p);
    }
</script>
</body>
</html>